'use strict';
/**
 * 结算组件
 */
(function (exports) {
    var $ = null;
    var ComboInfo = cc.Layer.extendEX({
        getRootNode: function () {
            return this.getChildByName('Layer');
        },
        ctor: function () {
            this._super();
            loadNodeCCSItem(zipai.res.ComboInfo_json , this);
            $ = create$(this.getRootNode());
            this.imgTag = $('imgTag');
            this.txtHx = $('txtHx');
            return true;
        },
        setData: function (data, comboList) {
            this.cardSprite = [];
            var cards = data.cards;
            for (var i = 0; i < cards.length; i++) {
                var cardNo = cards[i];
                var card = new Card();
                this.addChild(card);
                card.setData(cardNo, null, 2);
                card.setPosition(30, (3 - i) * 45 + 70);
                this.cardSprite[i] = card;
            }

            var comboType = data.typ;
            if (comboType != mCard.comboTypes.dui) {
                var imgName = mCard.comboImg[comboType - 1];
                this.imgTag.setContentSize(28, 28);
                var src = zipai.dynamicRes + 'result/c_' + imgName + '.png';
                if (imgName == null) {
                    cc.log('check imgName error !');
                }
                this.imgTag.setTexture(src);
                this.imgTag.setVisible(true);
                var hx = mCard.getComboHuXi(data);
                this.txtHx.setString(hx);
            } else {
                this.imgTag.setVisible(false);
                this.txtHx.setString('0');
            }
        },
        getCardSprite: function () {
            return this.cardSprite;
        },
    });
    exports.ComboInfo = ComboInfo;
})(window);